package com.sg.business.commons.labelprovider.work;

import org.eclipse.swt.graphics.Image;

import com.sg.business.model.WorkDeliverableDefinition;
import com.sg.business.resource.BusinessResource;
import com.sg.widgets.commons.labelprovider.ConfiguratorColumnLabelProvider;

public class WorkDeliDefMandatoryHtmlLabel extends
		ConfiguratorColumnLabelProvider {

	@Override
	public Image getImage(Object element) {
		if (element instanceof WorkDeliverableDefinition) {
			WorkDeliverableDefinition workDeliverableDefinition = (WorkDeliverableDefinition) element;
			Object mandotary = workDeliverableDefinition
					.getValue(WorkDeliverableDefinition.F_MANDATORY);
			if (mandotary != null && Boolean.TRUE.equals(mandotary)) {
				return BusinessResource
						.getImage(BusinessResource.IMAGE_WORK2_LOCKED_16);
			}
		}
		return null;
	}

	@Override
	public String getText(Object element) {
		return "";
	}
}
